var stack = []
var mins = []
function push(node)
{
    // write code here
    if(stack.length === 0) {
      stack.push(node)
      mins.push(node)
    }else {
      stack.push(node)
      node < mins[mins.length-1] ? mins.push(node) : mins.push(mins[mins.length-1])
    }
}
function pop()
{
    // write code here
    stack.pop()
    mins.pop()
}
function top()
{
    // write code here
    return stack[stack.length-1]
}
function min()
{
    // write code here
    return mins[mins.length-1]
}
module.exports = {
    push : push,
    pop : pop,
    top : top,
    min : min
};